<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>修改产品类型</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="description" content="修改产品类型">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/sm/pages/css/style.css">
<script type='text/javascript' src='/sm/dwr/interface/managerAjax.js'></script>
<script type='text/javascript' src='/sm/pages/js/validator.js'></script>
<script type='text/javascript' src='/sm/dwr/engine.js'></script>
<script type='text/javascript'>
    function submitForm(form){
          var form = document.getElementById("modForm");
          if(isNull(form.displayName.value)){
              alert("请输入产品类型名称！");
              return false;
          }
          form.submit();
    }
</script>
</head>
<body>
<form id="modForm" action="/sm/controller/typeItem/mod" method="POST">
<input type="hidden" name="id" value="${typeItem.id }"/>
<table>
	<tr>
		<td>产品类型名称</td><td><input type="text" name="displayName" value="${typeItem.displayName }"  maxlength="100"/></td>
	</tr>
	<tr>
		<td>父类型：</td>
		<td><select name="parentId">
			<c:if test="${typeItemList!=null}">
			    <option value="0">无</option>
				<c:forEach var="typeItemTemp" items="${typeItemList}" varStatus="status">
					<c:if test="${typeItemTemp.id != typeItem.id}">
					    <option value="${typeItemTemp.id}" <c:if test="${typeItemTemp.id == typeItem.parentId}">selected = "selected"</c:if>>${typeItemTemp.displayName}</option>
					</c:if>
				</c:forEach>
			</c:if>
		</select></td>
	</tr>
	<tr>
	    <td>&nbsp;</td>
	    <td><input type="button" value="修改" onclick="submitForm();"/></td>
	</tr>
</table>
</form>
</body>
</html>